#ifndef SPRITE_ANIMA_H
#define SPRITE_ANIMA_H
#include "sprite.h"
class spriteAnima:public sprite
{
    int currentFrame_ = 0;
    int totalframe_ = 0;
    int fps_ = 10;
    float frameTime_ = 0.0f;
    bool isLoop_ = true;
public:
    void setCurrnetFrame(int frame){currentFrame_ = frame;};
    void setTotalFrame(int frame){totalframe_ = frame;};
    void setFps(int fps){fps_ = fps;};
    void setFrameTime(float time){frameTime_ = time;};
    int getCurrnetFrame(){return currentFrame_;}
    int getTotalFrame(){return totalframe_;}
    int getFps(){return fps_;}
    bool isLoop(){return isLoop_;}
    void setLoop(bool loop){isLoop_ = loop;};
    float getFrameTime(){return frameTime_;}
    virtual void update(float dt) override;
    virtual void setData(const sprite_data& data) override;
    static spriteAnima* createAnima(screen* parent,const char* path,
        float scale = 1.0f,const char *name = "spriteAnima",Anchor anchro = Anchor::ANCHOR_CENTER);
};

#endif